PPCClose
You use thePPCClose
function to close the port specified by the port reference number.
FUNCTION PPCClose (pb: PPCClosePBPtr; async: Boolean): OSErr;
pb
- A pointer to a
PPCClose
parameter block.async
- A value that specifies whether the function is to be executed asynchronously (
TRUE
) or synchronously (FALSE
).
--> ioCompletion PPCCompProcPtr Address of a completion routine <-- ioResult OSErr Result code --> portRefNum PPCPortRefNum Port reference number of port to close DESCRIPTION
If your application calls this function asynchronously, you must specify in theioCompletion
field either the address of a completion routine orNIL
. If you setioCompletion
toNIL
, you should poll theioResult
field of the PPC parameter block (from your application's main event loop) to determine whether the PPC Toolbox has completed the requested operation. A value in theioResult
field other than 1 indicates that the call is complete. Note that it is unsafe to poll theioResult
field at interrupt time since the PPC Toolbox may be in the process of completing a call. See "PPC Toolbox Calling Conventions" beginning on page 11-14 for detailed information.The
portRefNum
field specifies the PPC port identifier of the port to close. The port reference number must be a valid port reference number returned from a previous call to thePPCOpen
function.ASSEMBLY-LANGUAGE INFORMATION
The trap macro and routine selector for thePPCClose
function are
Trap macro Selector _PPC $0009 The registers on entry and exit for this routine are
Registers on entry A0 Pointer to a parameter block D0 Selector code
Registers on exit D0 Result code RESULT CODES
noErr 0 No error notInitErr -900 PPC Toolbox has not been initialized yet noPortErr -903 Bad port reference number noGlobalsErr -904 System unable to allocate memory, critical error SEE ALSO
For an example of the use of thePPCClose
function, see Listing 11-19 on page 11-44.
Main | Top of Section | What's New | Apple Computer, Inc. | Find It | Feedback | Help